// JavaScript Document Lis-py_news
var app = angular.module('pyNews',[]);
app.controller('newsListController',function($scope,$http){
	// 查询所有新闻
	$scope.getNewsContent = function(){
		$http.get('../news/getNewsContent.do').success(
			function(response){
				$scope.list = response;
			}
		);
	}
	
	// 分页没搞懂pagination暂不设置
	// 分页控件
	/*$scope.newsPageConfig = {
		currentPage:1,
		totalItems:10,
		itemsPerPage:10,
		perPageOptions:[10,20,30,40,50],
		onchange:function(){
			$scope.getNewsPageContent($scope.newsPageConfig.currentPage,$scope.newsPageConfig.itemsPerPage);
		}
	}
	
	console.log("方法");
	
	$scope.getNewsPageContent = function(page,size){
		$http.get('../getNewsPageContent.do?page='+page+'&size='+size).success(
			function(response){
				$scope.list = response.rows;
				$scope.newsPageConfig.totalItems = response.total;
				
			}
		);
	}*/
});
